{echo:JS::import("form")}
{echo:JS::import('dialog?skin=tinysimple');}
{echo:JS::import('dialogtools');}
<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
<div class="container clearfix">
	{widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
	<div class="content clearfix uc-content">
		<h1 class="title"><span>我担保的资助：</span></h1>

		<div class="mt20 tab">
			<ul class="tab-head">
				<li>待审核<i></i></li>
				<li>已审核<i></i></li>
			</ul>
			<div class="tab-body">
			<!-- 待审核 -->
				<div>
					<table class="simple">
						<tr>
							<th width="70">申请时间</th><th width="40">申请金额</th><th width="40">还款金额</th> <th width="30">期限</th><th width="50">申请人</th> <th width="50">资助人</th><th width="70">资助时间</th><th width="70">还款时间</th><th width="80">状态 / 操作</th>
						</tr>
						{query:name=pd where=dbr_id eq $user[id] and is_ok eq 0 order=pd_id desc page=1 id=$obj1}
						<tr class="{if:$key%2==1}odd{else:}even{/if} {if:$item['status']==2}noborder{/if}">
							<td>{$item['sq_time']}</td> <td >{$currency_symbol}{$item['sq_money']}</td><td >{$currency_symbol}{$item['h_money']}</td><td >{$item['qx']}个月</td><td>{echo:Common::getC($item['sq_id'])['real_name']}</td> <td >{echo:Common::getC($item['fc_id'])['real_name']}</td><td >{$item['fc_time']}</td><td >{$item['h_time']}</td> <td>{echo:Common::getZzt($item[is_ok])} <a href="javascript:confirm_action('{url:/ucenter/zzsq_shisok/id/$item[pd_id]}','申请额度：<span class=red>{$currency_symbol}{$item['sq_money']}</span><br>还款额度：<span class=red>{$currency_symbol}{$item['h_money']}</span><br><br>确认要为此资助作担保吗？')" class="btn btn-main btn-mini">通过</a></td>
						</tr>
						{/query}
					</table>
					<div class="page-nav">{echo:$obj1->pagebar()}</div>
				</div>
			<!-- 已审核 -->
				<div>
					<table class="simple">
						<tr>
							<th width="90">申请时间</th><th width="40">申请金额</th><th width="40">还款金额</th> <th width="40">期限</th><th width="50">申请人</th> <th width="50">资助人</th><th width="90">资助时间</th><th width="90">还款时间</th><th width="40">状态</th>
						</tr>
						{query:name=pd where=dbr_id eq $user[id] and is_ok gt 0 order=pd_id desc page=1 id=$obj2}
						<tr class="{if:$key%2==1}odd{else:}even{/if} {if:$item['status']==2}noborder{/if}">
							<td>{$item['sq_time']}</td> <td >{$currency_symbol}{$item['sq_money']}</td><td >{$currency_symbol}{$item['h_money']}</td><td >5个月</td><td>{echo:Common::getC($item['sq_id'])['real_name']}</td> <td >{echo:Common::getC($item['fc_id'])['real_name']}</td><td >{$item['fc_time']}</td><td >{$item['h_time']}</td> <td>{echo:Common::getZzt($item[is_ok])}</td>
						</tr>
						{/query}
					</table>
					<div class="page-nav">{echo:$obj2->pagebar()}</div>
				</div>
			
			</div>
		</div>
	</div>
</div>

<script>
	function submit_sq(e){
		if(!e){
			var dbr = $("#dbr").val();
			var sq_je = $("#sq_je").val();
			var pass2 = $("#pass2").val();
			$.get("{url:/ucenter/jk_add}",{dbr:dbr,pass2:pass2,sq_je:sq_je},function(data){
				if(data['status']=='success'){
					art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>",2);
            		setTimeout("tools_reload()",2000);
					window.location.href = "{url:/ucenter/application_support/rand/}"+Math.random()+"#tab-1";
				}else{
					alert(data['msg']);
				}
			},'json');
		}
		return false;
	}
	// $("input[name='dbr']").on("change",function(event){
	// 	if(autoValidate.validate(event)){
	// 		$.post("{url:/ajax/dbr/dbr/}"+$(this).val(),function(data){
	// 		autoValidate.showMsg({id:document.getElementById('dbr'),error:!data['status'],msg:data['msg']});
	// 	},'json');
	// 	}
	// });
</script>
